package model.strategies;

import model.GameConstants;
import model.Player;
import model.Player.PlayerState;

/**
 * Strategy used to manage a player in the Escapee state.
 * @author N. Bhatia, A. Butt, N. Evans, C. Levesque, P. OKeefe
 *
 */
public class EscapeeStrategy extends MoveablePlayerStrategy{
	private final Player player;
	private int timeAsEscapee;

	public EscapeeStrategy(Player entity) {
		super(entity);
		this.player = entity;
		this.timeAsEscapee = 0;
		// TODO Auto-generated constructor stub
	}
	
	@Override
	public void  update(int elapsedTimeInMillis){
		super.update(elapsedTimeInMillis);
		timeAsEscapee += elapsedTimeInMillis;
		
		if (timeAsEscapee > GameConstants.MAX_TIME_AS_ESCAPEE_MILLIS){
			player.setState(PlayerState.PRISONER);
		}
	}

}
